# 导包
import requests

# 发送访问请求
response = requests.get(url='http://www.baidu.com')

# 获取响应状态码
print(response.status_code)

# 将编码格式转化为 UTF-8
response.encoding = 'UTF-8'
# 获取响应文本
print(response.text)

resp = requests.get('http://www.baidu.com/s?wd="武汉天气"')
print(resp.status_code)
print(resp.text)

response = requests.get('http://www.baidu.com/s', params={"wd": "武汉天气"})
print(response.status_code)
print(response.text)
